

package com.bolt.support.desensitization.desensitizer;


import com.bolt.support.desensitization.annotation.PhoneNumberSensitive;

/**
 * 手机号码脱敏器
 */
public class PhoneNumberDesensitizer extends AbstractCharSequenceDesensitizer<String, PhoneNumberSensitive> {

    @Override
    public String desensitize(String target, PhoneNumberSensitive annotation) {
        return required(target, annotation.condition()) ? String.valueOf(desensitize(target, annotation.regexp(), annotation.startOffset(), annotation.endOffset(), annotation.placeholder())) : target;
    }

}
